<template>
    <div class="ad" @click="openAd">
        <div class="adName">{{ title }}</div>
        <div class="adImg"><img class="IMG" :src=adImg alt="AdImg"></div>
    </div>
</template>

<script lang="ts" setup>

const props=defineProps({
    title:{
        type:String,
        default:'Immortality'
    },
    adImg:{
        type:String,
        default:'/systemImage/Immortality.png'
    },
    adLink:{
        type:String,
        default:'http://localhost:5173/Home'
    }
})

const ADlink=props.adLink

const openAd = function(){
    window.open(ADlink)
}

</script>

<style scoped>
.ad{
    display: flex;
    flex-direction: column;
    flex-grow: 1,5;
    justify-content: center;
    align-items: center;
    margin: 2px;
    gap:5px;
    border-radius: 5px;
    font-size: 50%;
    color: rgb(231, 253, 248);
    text-align: center;
    transition: all 0.4s ease;
    background-color: rgba(2, 2, 2, 0);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    width: 95%;
    height: 70px;
    cursor: pointer;
    box-shadow: 0px 0px 4px rgb(255, 255, 255);
}

.ad:hover{
    box-shadow: 0px 0px 24px rgb(1, 153, 208);
}

.adName{
    flex:1;
    text-align: center;
    width: 100%;
    background-color: rgb(0, 0, 0);
    border-radius: 5px;
}

.adImg{
    flex: 5;
    text-align: center;
    margin: 2px;
    
}

.IMG{
    width: 25%;
}
</style>